<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>test</title>
</head>
<body>
	<h1>test</h1>
</body>
<script type="text/javascript">
    
    Function.prototype.method = function(name,fn){
        this.prototype[name] = fn;
        return this;
    }
    
    var Anim = function(){
        this.name = 'Dog'
    }
    
    Anim.method('start',function(){
        alert('start')
    }).method('stop',function(){
        alert('stop')
    })

    // Anim.prototype.start=function(){
    //     alert('start')
    //     return this;
    // }

    // Anim.prototype.stop=function(){
    //     alert('stop')
    // }

    const anim = new Anim();

    console.log(anim)

    anim.start()
    anim.stop()

</script>
</html>